<?php
namespace app\admin\controller;

use app\common\model\HelpToRich as HelpToRichModel;

use app\common\component\help_to_rich\HelpToRichService;

class HelpToRich extends ControllerBase {
	public function _initialize() {
		$this -> checkLogin();

		$this -> checkAuthorization();
	}

	public function index() {
		$resultHelpToRich = HelpToRichModel::alias('h_t_r')
			-> join('league_user u', 'h_t_r.user_id = u.user_id')
			-> field(
				'h_t_r.help_to_rich_id, h_t_r.order_id, h_t_r.price, h_t_r.create_time, h_t_r.over_time, h_t_r.status, ' .
				'u.username, u.realname, u.phone, u.bank_code'
			)
			-> order('h_t_r.status ASC, h_t_r.help_to_rich_id DESC')
			-> paginate(10);
		$this -> view -> assign('helpToRichs', $resultHelpToRich);

		return $this -> view -> fetch();
	}
}
?>